require([
        "esri/map",
        "esri/layers/ArcGISDynamicMapServiceLayer",
        "esri/layers/FeatureLayer",
        'esri/SpatialReference',
        'esri/layers/GraphicsLayer',
        "esri/layers/LabelLayer",
        "esri/layers/LabelClass",
        'esri/graphic',
        'esri/geometry/Point',
        "esri/renderers/SimpleRenderer",
        "esri/symbols/TextSymbol",
        'esri/symbols/SimpleMarkerSymbol',
        'esri/symbols/SimpleFillSymbol',
        'esri/symbols/SimpleLineSymbol',

        'esri/Color',
        'esri/geometry/Circle',
        'dojo/on',
        "jquery/jquery-1.11.1"
    ],
    function(
        Map,
        ArcGISDynamicMapServiceLayer,
        FeatureLayer,
        SpatialReference,
        GraphicsLayer ,
        LabelLayer,
        LabelClass,
        Graphic,
        Point,
        SimpleRenderer,
        TextSymbol,
        SimpleMarkerSymbol,
        SimpleFillSymbol,
        SimpleLineSymbol,
        Color,
        Circle,
        on
    ) {
        var map = new Map("map", {
            //basemap: "osm",  //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
            center: [115.45, 37.75], // longitude, latitude
            zoom: 5,
            spacialReference:new SpatialReference(3857),
            showLabels:true
        });
        //var dynamicMap= new  ArcGISDynamicMapServiceLayer("http://192.168.1.105:6080/arcgis/rest/services/test/DT/MapServer",{
        //    //opacity: 0.6
        //});
        var NAME="NAME";

        var featureLayer = new FeatureLayer("http://192.168.1.105:6080/arcgis/rest/services/test/DT/MapServer/41", {
            mode: FeatureLayer.MODE_SNAPSHOT,
            outFields: ["*"],
            opacity:0.8
        });

        var labelSymbol = new TextSymbol();
        labelSymbol.font.setSize("14pt");
        labelSymbol.font.setFamily("微软雅黑");

        var labelRenderer = new SimpleRenderer(labelSymbol);
        var labels = new LabelLayer({id: "labels"});

        var json = {
            "labelExpressionInfo": {"value": "{NAME}"}
        };
        var labelClass = new LabelClass(json);
        labelClass.symbol=labelSymbol;
        featureLayer.setLabelingInfo([labelClass]);



        map.addLayer(featureLayer);
        //map.addLayer();
        on(map,"load", function () {
            $.ajax({
                type: "GET",
                url: "package.json",
                dataType: "json",
                async: false,
                success: function (data) {
                    //console.log(data);
                    var graphicsLayer = new GraphicsLayer();
                    map.addLayer(graphicsLayer);
                    for(var i= 0;i<data.length;i++){
                        //console.log(data[i]);
                        var point = new Point(data[i].LGTD,data[i].LTTD,map.spacialReference);
                        var graphic=new Graphic(point,new SimpleMarkerSymbol(
                            SimpleMarkerSymbol.STYLE_CIRCLE, 10,
                            new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
                                new Color([255,0,0]), 1),
                            new Color([0,255,0,0.25])),data[i]);
//                                    if(graphic.attributes.FRGRD!=map.getZoom()){
//                                        graphic.visible=false;
//                                    }
                        graphicsLayer.add(graphic);

                    }




                }
            })
        })
    });





/**
 * Created by Administrator on 2016/9/10.
 */
